<div ng-controller="UranusTaskCtrl">
    <form class="form-inline">
        <div class="form-group">
            <input type="text" class="form-control sheet-input" ng-model="query.taskName" name="taskName" placeholder="请输入持续集成任务名称">
        </div>
        <div class="form-group">
            <select class="form-control sheet-select" ng-model="query.versionId" ng-change="versionChange()" name="versionId" ng-options="option.id as option.version for option in versionList">
                <option value="">请选择版本</option>
            </select>
        </div>
        <div class="form-group">
            <select class="form-control sheet-select" ng-model="query.branchId" name="branchId" ng-options="option.branchId as option.branchName for option in branchList">
                <option value="">请选择分支</option>
            </select>
        </div>
        <div class="form-group">
            <select class="form-control sheet-select" ng-model="query.buildOrder" name="buildOrder"
                    ng-options="option.itemCode as option.itemName for option in buildOrderList">
                <option value="" style="display:none">请选择类型</option>
            </select>
        </div>
        <div class="form-group">
            <div class="search-div marginL" ng-click="paginationSearch(0,pagination.pageSize)">查询</div>
            <!--<button class="btn btn-default search-div" ng-click="paginationSearch(0,pagination.pageSize)">查询</button>-->
            <a href="javascrpit:void(0)" ui-sref="topHead.leftColumn.additionFlow({sysId:data.flow.sysId})" target="_blank" class="text-primary" style="margin-right: 20px;"><i class="fu fu-plus" style="color: #65B113"><span style="color: #11B983;font-size: 12px">创建任务</span></i></a>
        </div>
    </form>

    <div class="table-body">
        <table class="sn-table">
            <tr>
                <th width="5%"></th>
                <th>任务名称</th>
                <th>类型</th>
                <th>分支</th>
            </tr>
            <tr ng-repeat="taskItem in pagination.data">
                <td>
                    <input type="radio" name="inlineRadioOptions" ng-click="selectTask($event,taskItem)"
                           data="{{taskItem}}" id="{{taskItem.buildTaskId}}" value="{{taskItem.buildTaskId}}">
                </td>
                <td class="text_overflow_task" title="{{taskItem.taskName}}">
                    {{taskItem.taskName}}
                </td>
                <td class="text_overflow_task">
                    <span ng-repeat="orderItem in buildOrderList" ng-if="orderItem.itemCode==taskItem.buildOrder" title="{{orderItem.itemName}}">
                        {{orderItem.itemName}}
                    </span>
                </td>
                <td class="text_overflow_task" title="{{taskItem.branchPath}}">
                    {{taskItem.branchPath}}
                </td>
            </tr>
            <tr ng-if="!pagination||!pagination.data||pagination.data.length<1">
                <td colspan="5">暂无数据</td>
            </tr>
        </table>
    </div>


             <cd-pager style="float: right" page="pagination.page" page-size="pagination.pageSize"
         total="pagination.totalCount" page-action="paginationSearch(page, pageSize, total)"></cd-pager>
    <div class="form-group">
        <button class="btn btn-default cancelbutton" ng-click="curr(0)">上一步</button>
        <button class="btn btn-primary" ng-click="save()" ng-disabled="!selectTaskList||selectTaskList.length<1">确定</button>
    </div>
</div>
<style type="text/css">
    input.form-control {
        height: 28px;
    }
    .sn-table {
        border: 1px solid #e0e0e0;
        width: 100%;
        border-collapse: collapse
    }

    .sn-table th {
        font-size: 14px;
        color: #687B93;
        font-weight: 700
    }

    .sn-table td,
    .sn-table th {
        height: 38px;
        text-align: left;
        padding-left: 40px;
    }

    .sn-table td {
        font-size: 12px;
        padding: 6px 0;
        padding-left: 40px;
    }
    .sn-table td:last-of-type{
        font-size: 12px;
        color: #333;
        padding: 6px 0;
        padding-left: 40px;
        text-align: center
    }
    .sn-table td a {
        color: #11B983;
        margin: 0 10px;
        cursor: pointer
    }

    .sn-table td:first-of-type,
    th:first-of-type {
        padding-left: 20px;
        width: 150px;
        text-align: center
    }
    th:last-of-type {
        width: 150px;
        text-align: center
    }


    .sn-table tr:nth-child(odd) {
        background-color: #F6F7F9;
    }

    .sn-table tr:first-child {
        background-color: #F6F7F9;
    }

    .sn-table-btn-group {
        width: 35%
    }

    .sn-table-pager {
        width: 65%
    }

    .sn-table-pager ul {
        margin: 0
    }

    .table-text {
        margin-top: 10px;
        font-size: 12px;
        color: #333
    }

    .table-text a {
        margin-left: 20px;
        color: #3a8cbb;
        cursor: pointer
    }
    td {
        border: 0;
    }

    input {
        height: 26px;
        padding-left: 10px;
        padding-right: 0px;
        border: 1px solid #ddd;
        color: #333;
        width: 170px;
    }

    input.form-control {
        height: 28px;
    }
    input.sheet-input, select.sheet-select{
        width:150px !important;
        height:26px;
        padding-top:0;
        padding-bottom:0;
        color:#c9c9c9;
    }
    input.sheet-input::-webkit-input-placeholder{
        color:#c9c9c9;
    }

</style>
